package com.xinminda.dcf.ui.personal.presenter;

import com.xinminda.dcf.base.baserx.RxSubscriber;
import com.xinminda.dcf.bean.UserBean;
import com.xinminda.dcf.ui.personal.contract.LoginContract;
import com.xinminda.dcf.utils.ToastUtil;

public class LoginPresenter extends LoginContract.Presenter{
    @Override
    public void getLoginRequest(String header, String params) {
        mModel.getLoginData(header, params)
                .subscribe(new RxSubscriber<UserBean>(mContext,true){
                    @Override
                    protected void _onNext(UserBean userBean) {
                        ToastUtil.showShort("登录成功");
                        mView.returnLoginData();
                    }

                    @Override
                    protected void _onError(String message) {
                        ToastUtil.showShort(message);
                    }
                });
    }
}
